package com.lagou.edu.dao;

import com.lagou.edu.pojo.LagouUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author shenxiang
 * @date 2020/7/1 21:17
 * @description
 */
public interface LagouUserDao extends JpaRepository<LagouUser,Long> {

    @Query(value = "SELECT * FROM lagou_user WHERE username = ?1",nativeQuery = true)
    LagouUser getByUsername(String username);

    @Query(value = "SELECT * FROM lagou_user WHERE username = ?1 AND password = ?2",nativeQuery = true)
    LagouUser getByUsernameAndPassword(String username,String password);
}
